A bilateral filter is a nonlinear filter that may smooth an image while preserving strong edges. The bilateral filter considers both spatial and photometric differences between a pixel under consideration Y({right arrow over (r)}) where {right arrow over (r)}=(x1, . . . ,xm) (m≧1) and its neighbors Y({right arrow over (r)}′) to produce a surrounding function w({right arrow over (r)},{right arrow over (r)}′). The surrounding function is than convoluted with image Y ({right arrow over (r)}) to yield the output image:
                                          X            (                          r              ->                        )                    =                                    1                              v                (                                  r                  ->                                )                                      ⁢                                          ∑                                                      r                    ->                                    ′                                                                                              ⁢                                                w                  (                                                            r                      ->                                        ,                                                                  r                        ->                                            ′                                                        )                                ·                                  Y                  (                                                            r                      ->                                        ′                                    )                                                                    ⁢                                  ⁢                              v            (                          r              ->                        )                    =                                    ∑                                                r                  ->                                ′                                                                                  ⁢                          w              (                                                r                  ->                                ,                                                      r                    ->                                    ′                                            )                                                          (                  Equation          ⁢                                          ⁢          1                )            The function w({right arrow over (r)},{right arrow over (r)}′) is dependent on both a photometric value of the pixel Y({right arrow over (r)}) and pixel position {right arrow over (r)}, so thatw({right arrow over (r)},{right arrow over (r)}′)=ws({right arrow over (r)}−{right arrow over (r)}′)·wph(Y({right arrow over (r)})−Y({right arrow over (r)}′))  (Equation 2)where ws is a spatial component and wph is a photometric component.
Typically, Gaussian functions are used for both the spatial and the photometric component:
                                          w            s                    (                      r            ->                    )                =                  exp          (                      -                                                                                                                        r                      ->                                        -                                                                  r                        ->                                            ′                                                                                        2                                            σ                s                2                                              )                                    (                  Equation          ⁢                                          ⁢          3                )            and for the photometric component:
                                          w            ph                    (                                    r              ->                        ,                                          r                ->                            ′                                )                =                  exp          (                      -                                                            (                                                            Y                      (                                              r                        ->                                            )                                        -                                          Y                      (                                                                        r                          ->                                                ′                                            )                                                        )                                2                                            σ                ph                2                                              )                                    (                  Equation          ⁢                                          ⁢          4                )            while σs and σph are constants.
Convolution with spatial component can be calculated efficiently by way of Fast Fourier Transform (FFT). However, calculations of Equation 1 with a photometric component wph(Y({right arrow over (r)}),Y({right arrow over (r)}′)) may not be preformed by FFT and may involve a large computational cost. The computational cost of the above described bilateral filter may be estimated to be O(N)operations per pixel where N is the number of pixels in support. One method to decrease the computational cost is by approximate filter calculation. Alternatively, bilateral filtering may be calculated by an iterative method.